package edu.spec.teacher.model;

import edu.spec.basic.model.User;
import edu.spec.basic.model.enumeration.Status;
import edu.spec.basic.model.enumeration.YesNo;

import javax.persistence.*;
import java.util.Date;

/**
 * Author       : MadFrog
 * Date         : 2018/10/5 16:43
 * Description  : 选举主题
 */
@Entity
@Table(name = "t_elect")
public class Elect {
    private Integer id;
    private String title;
    private String description;
    private Integer electedNumber;
    private String voter;
    private String candidate;
    private Integer completeNumber;
    private String completeRatio;
    private String fact;
    private Date closeDate;
    private YesNo allowAbstain;
    private User creator;
    private Date createDate;
    private Status status;

    public Elect() {
    }

    @Id
    @GeneratedValue
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getFact() {
        return fact;
    }

    public void setFact(String fact) {
        this.fact = fact;
    }

    @Column(name = "elected_number")
    public Integer getElectedNumber() {
        return electedNumber;
    }

    public void setElectedNumber(Integer electedNumber) {
        this.electedNumber = electedNumber;
    }

    public String getVoter() {
        return voter;
    }

    public void setVoter(String voter) {
        this.voter = voter;
    }

    public String getCandidate() {
        return candidate;
    }

    public void setCandidate(String candidate) {
        this.candidate = candidate;
    }

    @Column(name = "complete_number")
    public Integer getCompleteNumber() {
        return completeNumber;
    }

    public void setCompleteNumber(Integer completeNumber) {
        this.completeNumber = completeNumber;
    }

    @Column(name = "complete_ratio")
    public String getCompleteRatio() {
        return completeRatio;
    }

    public void setCompleteRatio(String completeRatio) {
        this.completeRatio = completeRatio;
    }

    @Column(name = "close_date")
    public Date getCloseDate() {
        return closeDate;
    }

    public void setCloseDate(Date closeDate) {
        this.closeDate = closeDate;
    }

    @Column(name = "allow_abstain")
    public YesNo getAllowAbstain() {
        return allowAbstain;
    }

    public void setAllowAbstain(YesNo allowAbstain) {
        this.allowAbstain = allowAbstain;
    }

    @ManyToOne
    @JoinColumn(name = "creator_id")
    public User getCreator() {
        return creator;
    }

    public void setCreator(User creator) {
        this.creator = creator;
    }

    @Column(name = "create_date")
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }
}
